<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>华为商城(VMALL.COM)</title>
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<link rel="stylesheet" type ="text/css" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/iconfont.css"/>
		<link rel="stylesheet" type ="text/css" href="css/home.css" />
	</head>
	<body>
		<!--网站导航-->
		<div id="header_wrapper">
			<div class = "header content">
				<div class ="nav">
					<ul>
						<li>
							<a href="index.html">首页</a>
						</li>
						<li>
							<a href="#">华为官网</a>
						</li>
						<li>
							<a href="#">荣耀官网</a>
						</li>
						<li>
							<a href="#">花粉俱乐部</a>
						</li>
						<li>
							<a href="#">V码(优购码)</a>
						</li>
						<li>
							<a href="#">企业购</a>
						</li>
						<li>
							<a href="#">Select Region</a>
						</li>
					</ul>
					<ul>
						<li>
							<i class ="logged" style="visibility:hidden;">已登录</i>
							<a href="#" id ="login">请登录</a><a href="register.html" id = "register">注册</a>
						</li>
						<li>
							<a href="#">我的订单</a>
						</li>
						<li class ="user_service">
							<a href="#">客户服务</a>
							<span class = "iconfont icon-xiajiantou1"></span>
							<ol class ="user_que" style ="display:none;z-index:100;">
								<li>
									<a href="#">帮助中心</a>
								</li>
								<li class ="que_li">
									<a href="#">联系客服</a>
								</li>
							</ol>
							
						</li>
						<li>
							<a href="#">网站导航</a>
							<span class = "iconfont icon-xiajiantou1"></span>
						</li>
						<li>
							<a href="#">手机版</a>
							<span class = "iconfont icon-xiajiantou1 sj"></span>
						</li>
						<li>
							<a href="" class="cart_link">购物车：<span id ="cartnum">0</a>
							<span class ="iconfont icon-xiazai49 gouwuche"></span>
						</li>
					</ul>
				</div>
			</div>
			
		</div>
		<!--logo-->
		<div id="logo_wrapper">
			<div class ="logo_nav content">	
				<div class ="logo">
					<a href="index.html" >
						华为商城
						<img src="images/logo.png"/>
					</a>
				</div>
				<div class="nav_center">
					<ul>
						<li>
							<a href="#">
								<img src="images/zq1.png"/>
							</a>
						</li>
						<li>
							<a href="#">
								<img src="images/zq2.png"/>
							</a>
						</li>
						<li>
							<a href="#">Mate 20系列</a>
						</li>
						<li>
							<a href="#">荣耀V20</a>
						</li>
						<li>
							<a href="#">开门红</a>
						</li>
						<li>
							<a href="#">荣耀10</a>
						</li>
					</ul>
				</div>
				<div class ="search">
					<input type="text" value="华为Mate20 X" id ="search_i"/>
					<input type="button" name="" id="" value=" " />
					<span class= "iconfont icon-sousuo"></span>
				</div>
			</div>
		</div>
		<!--轮播图和商品导航-->
		<div id="banner_wrapper">
			<div class ="banner content">	
				<ul class ="banner_img">
					<li style="z-index:5;background:url(images/bg1.jpg) no-repeat center;">
						<a href="">
						</a>
					</li>
					<li style="z-index:4;background:url(images/bg2.jpg) no-repeat center;">
						<a href="">
					
						</a>
					</li>
					<li style="z-index:3;background:url(images/bg3.jpg) no-repeat center;">
						<a href="">
					
						</a>
					</li>
					<li style="z-index:2;background:url(images/bg4.jpg) no-repeat center;">
						<a href="">
							
						</a>
					</li>
					<li style="z-index:1;background:url(images/bg5.jpg) no-repeat center;">
						<a href="">
							
						</a>
					</li>
				</ul>
				<ol id = "bgNum" style="z-index:99;">
					<li class ="current"></li>
					<li></li>
					<li></li>
					<li></li>
					<li></li>
				</ol>
				<span class ="left_bg" ><i class ="iconfont icon-jiantou2"></i></span>
				<span class ="right_bg"><i class ="iconfont icon-arrow-right-copy-copy"></i></span>
			</div>
			<ul class="menu_list">
				<li class="honnur"><a href="#">手机</a><br /><a href="#">荣耀</a>&nbsp;<a href="">华为Mate P系列</a>
					<ul class="rongyao" style="display: none;">
						<div>
							<li><a href="#"><img src="images/rongyao.png"/>荣耀</a></li>
							<li><a href="#"><img src="images/mate1.png"/>HUAWEI P系列</a></li>
							<li><a href="#"><img src="images/changwan.png"/>华为畅玩系列</a></li>
							<li class ="mate"><a href="#"><img src="images/mate2.png"/>HUAWEI Mate系列</a></li>
						</div>
						<div>
							<li><a href="#"><img src="images/rongyao.png"/>荣耀</a></li>
							<li><a href="#"><img src="images/mate1.png"/>HUAWEI P系列</a></li>
							<li><a href="#"><img src="images/changwan.png"/>华为畅玩系列</a></li>
							<li class ="mate"><a href="#"><img src="images/mate2.png"/>HUAWEI Mate系列</a></li>
						</div>
					</ul>
				</li>
				<li><a href="#">笔记本 & 平板</a><br /><a href="#">平板电脑 </a><a href="">笔记本电脑</a></li>
				<li><a href="#">智能穿戴</a><br /><a href="#">手环</a>&nbsp;<a href="">手表</a><a href="">  VR</a></li>
				<li><a href="#">智能家居</a><br /><a href="#">路由器 </a><a href="">电视盒子</a><a href=""> 照明</a></li>
				<li><a href="#">通用配件</a><br /><a href="#">移动电源 </a><a href="">耳机</a>&nbsp;<a href="">音箱</a></li>
				<li><a href="#">专属配件</a><br /><a href="#">保护壳 </a><a href="#">保护套</a>&nbsp;<a href="">贴膜</a></li>
			</ul>
		</div>
		<div id="main_wrapper">
			<div class="img_phone content">
				<a href="mate20_details.html"><img src="images/phone1.jpg"/></a>
				<a href="mate20_details.html"><img src="images/phone2.png"/></a>
				<a href="mate20_details.html"><img src="images/phone3.png"/></a>
				<a href="mate20_details.html"><img src="images/phone4.png"/></a>
			</div>
			<div class="hot_phone content">
				<h2>热销单品</h2>
				<div class="changwan">
					<a href="mate20_details.html">
						<img src="images/changxiang.jpg"/>
					</a>
				</div>
				<div class="hot_list">
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
					<div class="hot">	
						<a href="mate20_details.html">
							<span>爆款</span>
							<img src="images/phone_s.png"/>
							<span>荣耀V10</span>
							<span>限时优惠1100</span>
							<span class ="price">￥1999</span>
						</a>
					</div>
				</div>
			</div>
			<div class="MateBook content">
					
				<h3>笔记本电脑</h3>
				<div class ="more">
					<a href="#">平板电脑</a><a href="#">笔记本电脑</a><a href="#">笔记本配件</a>
					<a href="#">查看更多<span class ="iconfont icon-arrow-right-copy-copy"></span></a>
				</div>
				
				<div class="BookC">
					<div class="Book_img">
						<a href="#">
							<img src="images/computer.png"/>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="mate20_details.html">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="#">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>限时优惠1100</span>
							<span class ="price">￥4099</span>
						</a>
					</div>
					<div class="Book_hot">
						<a href="#">
							<span>免息</span>
							<img src="images/ziyun.png"/>
							<span>荣耀MagicBook 锐龙星云紫版</span>
							<span>高颜值时尚轻薄本 </span>
							<span class ="price">￥4099</span>
						</a>
					</div>
				</div>
			</div>
			<div class = "phone_all content">
				<div class ="phone_title">
					<ul>
						<li>手机</li>
						<li>
							<a href="#">荣耀</a>
						</li>
						<li>
							<a href="#">HUAWEI P系列</a>
						</li>
						<li>
							<a href="#">荣耀畅玩系列</a>
						</li>
						<li>
							<a href="#">HUAWEI Mate系列</a>
						</li>
						<li>
							<a href="#"> HUAWEI nova系列</a>
						</li>
						<li>
							<a href="#">华为畅享系列</a>
						</li>
						<li>
							<a href="#">HUAWEI 麦芒系列</a>
						</li>
						<li>
							<a href="#">移动4G+专区</a>
						</li>
						<li>
							<a href="#">查看更多<span class ="iconfont icon-arrow-right-copy-copy"></span></a>
						</li>
					</ul>
				</div>
				<div class="phone_list">
					<div class="phone_list_img">
						<a href="mate20_details.html">
							<img src="images/nans.jpg"/>
						</a>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nov.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nov.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nov.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nov.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nans2.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nans2.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="mate20_details.html">
							<img src="images/nans2.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/nans2.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/nans2.png"/>
							<span>荣耀Magic2</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/honor.png"/>
							<span>荣耀畅玩7X</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/honor.png"/>
							<span>荣耀畅玩7X</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/honor.png"/>
							<span>荣耀畅玩7X</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/honor.png"/>
							<span>荣耀畅玩7X</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
					<div class="phone_list_all">
						<a href="#">
							<img src="images/honor.png"/>
							<span>荣耀畅玩7X</span>
							<span>购机享多重权益 </span>
							<span class ="price">￥3799</span>
						</a>
						<span id="add_cart">加入购物车</span>
					</div>
				</div>
			</div>
			<div class="newuser content">
				<a href="#">
					<img src="images/newUser.jpg"/>
				</a>
			</div>
		</div>
		<div id ="footer_wrapper">
			<div class ="link content">
				<div class ="link_l">
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
					<ul>
						<li>购物相关</li>
						<li>
							<a href="#">配送方式</a>
						</li>
						<li>
							<a href="#">支付方式</a>
						</li>
						<li>
							<a href="#">常见问题</a>
						</li>
						<li>
							<a href="#">购物指南</a>
						</li>
					</ul>
				</div>
				<div class="link_r">
					<span>400-088-6888</span><br />
					<span>7x24小时客服热线（仅收市话费）</span>
					<a href="#">在线客服<span class ="iconfont icon-wodekefu"></span></a>
					<span>关注Vmall：
						<ul>
							<li>
								<a href="#" class="iconfont icon-weibo"></a>
							</li>
							<li>
								<a href="#" class="iconfont icon-huawei"></a>
							</li>
							<li>
								<a href="#" class="iconfont icon-weixin"></a>
							</li>
						</ul>
					</span>
				</div>
			</div>
			<div class="footer_nav content">
				<a href="#">
					<img src="images/logo_f.png" />
				</a>
				<div class="footer_link">
					<ul>
						<li>
							<a href="#">华为集团</a> |
						</li>
						<li>
							<a href="#">华为CBG官网</a> |
						</li>
						<li>
							<a href="#">荣耀官网</a> |
						</li>
						<li>
							<a href="#">花粉俱乐部</a> |
						</li>
						<li>
							<a href="#">华为应用市场</a> |
						</li>
						<li>
							<a href="#">EMUI</a> |
						</li>
						<li>
							<a href="#">华为终端云空间</a> |
						</li>
						<li>
							<a href="#">开发者联盟</a> |
						</li>
						<li>
							<a href="#">华为商城手机版</a> |
						</li>
						<li>
							<a href="#">网站地图</a>
						</li>
					</ul>
					<p>隐私声明 服务协议 COOKIES Copyright &copy;2012-2019 华为软件技术有限公司 版权所有 保留一切权利<br />
						公安备案 苏公网安备32011402010009号 | 苏ICP备17040376号-6<br />
						增值电信业务经营许可证：苏B2-20130048号| 网络文化经营许可证：苏网文[2015] 1599-026号
					</p>
				</div>
			</div>
		</div>
		<div class="fixed_menu">
			<!--<div class="menu_list">-->
				<a id ="cart_href">
					<span class="iconfont icon-xiazai49"></span>
					<span id="num">0</span>
					<i class="cart">购物车</i>
				</a>
				<a href="#">
					<span class="iconfont icon-wodekefu"></span>
					<i class ="service">在线客服</i>
				</a>
				<a href="#">
					<span class="iconfont icon-yijianfankui"></span>
					<i  class="advice">意见反馈</i>
				</a>
				<a href="#">
					<span class="iconfont icon-fanhuidingbu"></span>
					<i class ="goTop">返回顶部</i>
				</a>
			<!--</div>-->	
		</div>
		<div id ="login_page" style="visibility:hidden;z-index:999;">
			<div class="delete">
				<button id="del_btn" style="background:url(images/XX_03.jpg);"></button>
			</div>
			<div class="id_login">
				<div class ="login_i">
					<div class ="login_op">
						<span>账号登录</span>
						<span>扫码登录</span>
					</div >
				</div>
				<form>
					<div class="login_ipt">
						<input type="text" name="phoneNum" id="phoneNum"  placeholder="手机号"/>
						<input type="password" name="pwd" id="pwd" placeholder="密码" />
						<input type="button" id ="login_btn" value="登录"/>
						<!--<p class="errInfo">手机号或密码不正确</p>-->
					</div>
					<a href ="register.html">注册账号</a>
				</form>
			</div>
			<!--<div class ="QRCode_login" style ="none"></div>-->
		</div>
		
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/login.js"></script>
		<!--<script type="text/javascript" src="js/common.js"></script>-->
		<script>
			$(function(){
				//是否是刚注册
				if(localStorage.getItem("reg_phone")){
					$("#login_page").css("visibility","visible");
				}
//				显示用户
				if(localStorage.getItem("phoneNum")){
					$(".logged").css({
						visibility:"visible",
						left:"-40px"
					});
					$("#login").css("display","none");
					$("#login_page").css("visibility","hidden");
				}
				//购物车等固定栏动画
				$(".fixed_menu>a:nth-child(1)").hover(function(){
					$(".cart").show();
				},function(){
					$(".cart").hide();
				})
				$(".fixed_menu>a:nth-child(2)").hover(function(){
					$(".service").show();
				},function(){
					$(".service").hide();
				})
				$(".fixed_menu>a:nth-child(3)").hover(function(){
					$(".advice").show();
				},function(){
					$(".advice").hide();
				})
				$(".fixed_menu>a:nth-child(4)").hover(function(){
					$(".goTop").show();
				},function(){
					$(".goTop").hide();
				}).click(function(){
					$("body,html").animate({
						scrollTop:0
					},500);
				})
				$(window).scroll(function(){
					if($(window).scrollTop() < 1000){
						$(".fixed_menu>a:nth-child(4)").hide();
					}else{
						$(".fixed_menu>a:nth-child(4)").show();
					}
				});
				//显示login页面
				$("#login").click(function(){
					$("#login_page").css({
						"visibility":"visible"
					}).siblings().css("opacity",0.6);
					
				});
				$("#del_btn").click(function(){
					$("#login_page").css({
						"visibility":"hidden"
					}).siblings().css("opacity",1);
				});
		//				客户服务
				$(".user_service").hover(function(){
					
					$(".user_que").show();
				},function(){
					$(".user_que").hide();
				});
				$("#search_i").focus(function(){
					console.log($(this));
					
					$(this).val(" ");
				}).blur(function(){
					$(this).val("华为Mate20 X");
				});
				
			});
			//轮播图
			var index = 0;
			var timer = setInterval(autoPlay,2000);
			function autoPlay(){
				index++;
				$(".banner_img li").eq(index).fadeIn(1000).siblings().fadeOut(1000);
				$("#bgNum li").eq(index).addClass("current").siblings().removeClass("current");
				if(index == $(".banner_img>li").size() - 1){
					index = -1;
				}
			}
			$("#bgNum>li").mouseenter(function(e){
				var e = e || event;
				clearInterval(timer);
				index = $(this).index() - 1;
				console.log(index);
				autoPlay();
				e.stopPropagation();
			}).mouseleave(function(e){
				var e = e || event;
				timer = setInterval(autoPlay,2000);
				e.stopPropagation();
			})
			//移入到banner图，停止轮播
			$(".banner").mouseover(function(){
				clearInterval(timer);
			}).mouseout(function(){
				timer = setInterval(autoPlay,2000);
			})
			$(".right_bg").click(function(){
//				index = $(this).index() + 1;
				clearInterval(timer);
				autoPlay();
			})
			$(".right_bg").mouseover(function(){
				$(this).css("opacity",0.7);
			}).mouseout(function(){
				$(this).css("opacity",0.3);
			})
			$(".left_bg").mouseover(function(){
				$(this).css("opacity",0.7);
			}).mouseout(function(){
				$(this).css("opacity",0.3);
			})
			$(".left_bg").click(function(){
				clearInterval(timer);
				index--;
				if(index == $(".banner_img li").size()){
					index = 0;
				}
				if(index == -1){
					index = $(".banner_img li").size() - 1;
				}
				$(".banner_img li").eq(index).fadeIn(1000).siblings().fadeOut(1000);
				$("#bgNum li").eq(index).addClass("current").siblings().removeClass("current");
			})
			//menu_list动画
			$(".honnur").hover(function(){
				$(this).css("background","#fff");
				$(".rongyao").css("display","block");
			},function(){
				$(this).css("background","#fcfcfc");
				$(".rongyao").css("display","none");
			})
			$(".cart_link").click(function(){
				var phone = JSON.parse(localStorage.getItem("phoneNum"));
				$(this).attr("href","ShoppingCart.html?phoneNum="+ phone);
				//location.href = "ShoppingCart.html?phoneNum="
			})
//			购物车效果
			$(function(){
				var obj = {
					phoneNum : JSON.parse(localStorage.getItem("phoneNum")),
					pwd : JSON.parse(localStorage.getItem("pwd")),
					btn : $("#login_btn"),
					oGoods : $(".phone_list"),
					oCart : $("#cart_href"),
					Num : $("#num"),
					cartNum :$("#cartnum")
				}
				new ShowGoods(obj).init();
			});
			class ShowGoods{
				constructor(obj){
					this.btn = obj.btn;
					this.phoneNum = obj.phoneNum;
					this.btn = obj.btn;
					this.oGoods = obj.oGoods;
					this.oCart = obj.oCart;
					this.Num = obj.Num;
					this.cartNum = obj.cartNum;
				}
				init(){//初始化
					this.loadingGoods();
//					alert(1);
				}
				loadingGoods(){
//					var xhr = new XMLHttpRequest();
//					xhr.open("GET","huawei.json");
//					xhr.send();
//					xhr.onreadystatechange = function(){
//						if(xhr.readyState == 4){
//							if(xhr.status == 200){
//								var res = JSON.parse(xhr.responseText);
//							}
//						}
//					}
//					console.log(1);
					$.getJSON("huawei.json",function(res){
						var str = "";
						console.log(res);
						for (var i = 0; i < res.length; i++) {
						 	str += `
						 		<div class="phone_list_all">
									<a href="mate20_details.html">
										<input type = "hidden" value="${res[i].bid}" class="goodBid"></input>
										<img src="${res[i].src}"/>
										<span>${res[i].phoneName}</span>
										<span>购机享多重权益 </span>
										<span class ="price">${res[i].price}</span>
									</a>
									<span id="add_cart">加入购物车</span>
								</div>
						 	`;
						}
						this.oGoods.html(str);
						//加载商品
						this.addCart();
						
						//计算购物车数量
						this.computeNum();
						//点击购物图标跳转到购物车页面
						this.goToCartPage();
						
					}.bind(this));
				}
				addCart(){
					//点击加入购物车按钮
//					console.log(this.oGoods.find(".phone_list_all>#add_cart"));
					var _this = this;
					this.oGoods.find(".phone_list_all>#add_cart").click(function(){
						var bid = $(this).parent().find(".goodBid").val();
						console.log(bid);
						var obj = [
							{
								"bid":bid,
								"num":1//数量
							}
						];
						var objStr = JSON.stringify(obj);
						//把要购买的商品id号和数据保存到购物车中
						//需要获取购物车中的所有信息
						if(localStorage.getItem(_this.phoneNum+"goods")){
							//如果商品信息存在，判断当前选中的商品编号在原信息中是否有
							//如果信息不存在，返回空，添加一条数据
							//如果有，说明要对该商品添加一个数量
							var storGoods = localStorage.getItem(_this.phoneNum+"goods");
							var storGoodsJson = JSON.parse(storGoods);
							
							var flag = false;//表示原商品信息中不存在点击的这个商品
							for (var i = 0; i < storGoodsJson.length; i++) {
								if(storGoodsJson[i].bid == bid){//存在
									storGoodsJson[i].num++;
									flag =true;
									break;
								}
							}
							if(!flag){//不存在点击的这个商品
								//添加一条数据
								var goodObj = {"bid":bid,"num":1};
								storGoodsJson.push(goodObj)	;
								
							}
							var storGoodsStr = JSON.stringify(storGoodsJson);
							//把添加好的这些商品保存到购物车
							localStorage.setItem(_this.phoneNum+"goods",storGoodsStr);
						}else{//商品不存在
							//添加一条该商品数据
							localStorage.setItem(_this.phoneNum+"goods",objStr);
						}
						//计算购物车的数量
						_this.computeNum();
					})
				}
				computeNum(){
					//在购物车显示数量cartGoodsNum
					if(localStorage.getItem(this.phoneNum+"goods")){
						var storGoodsStr = localStorage.getItem(this.phoneNum+"goods");
//						alert(1);
						console.log(storGoodsStr);
						var storGoodsJosn = JSON.parse(storGoodsStr);
						var num = 0;
						for (var i = 0; i < storGoodsJosn.length; i++) {
						 num +=	Number(storGoodsJosn[i].num);
						}
						console.log(num);
						console.log(this.phoneNum);
						this.Num.text(num);
						this.cartNum.text(num);
					}
				}
				goToCartPage(){
					var _this = this;
					this.oCart.click(function(){
						location.href = "ShoppingCart.html?phoneNum=" + _this.phoneNum;
					});
				}
			}
			
		</script>
	</body>
</html>
